3.56 \(\int \frac{a+b \tan ^{-1}(c x)}{x^2 (d+i c d x)^2} \, dx\)

Optimal. Leaf size=194 \[ \frac{b c \text{PolyLog}(2,-i c x)}{d^2}-\frac{b c \text{PolyLog}(2,i c x)}{d^2}+\frac{b c \text{PolyLog}\left (2,1-\frac{2}{1+i c x}\right )}{d^2}+\frac{c \left (a+b \tan ^{-1}(c x)\right )}{d^2 (-c x+i)}-\frac{a+b \tan ^{-1}(c x)}{d^2 x}-\frac{2 i c \log \left (\frac{2}{1+i c x}\right ) \left (a+b \tan ^{-1}(c x)\right )}{d^2}-\frac{2 i a c \log (x)}{d^2}-\frac{b c \log \left (c^2 x^2+1\right )}{2 d^2}-\frac{i b c}{2 d^2 (-c x+i)}+\frac{b c \log (x)}{d^2}+\frac{i b c \tan ^{-1}(c x)}{2 d^2} \]

[Out]

((-I/2)*b*c)/(d^2*(I - c*x)) + ((I/2)*b*c*ArcTan[c*x])/d^2 - (a + b*ArcTan[c*x])/(d^2*x) + (c*(a + b*ArcTan[c*
x]))/(d^2*(I - c*x)) - ((2*I)*a*c*Log[x])/d^2 + (b*c*Log[x])/d^2 - ((2*I)*c*(a + b*ArcTan[c*x])*Log[2/(1 + I*c
*x)])/d^2 - (b*c*Log[1 + c^2*x^2])/(2*d^2) + (b*c*PolyLog[2, (-I)*c*x])/d^2 - (b*c*PolyLog[2, I*c*x])/d^2 + (b
*c*PolyLog[2, 1 - 2/(1 + I*c*x)])/d^2

________________________________________________________________________________________

Rubi [A]  time = 0.241161, antiderivative size = 194, normalized size of antiderivative = 1., number of steps used = 18, number of rules used = 15, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.652, Rules used = {4876, 4852, 266, 36, 29, 31, 4848, 2391, 4862, 627, 44, 203, 4854, 2402, 2315} \[ \frac{b c \text{PolyLog}(2,-i c x)}{d^2}-\frac{b c \text{PolyLog}(2,i c x)}{d^2}+\frac{b c \text{PolyLog}\left (2,1-\frac{2}{1+i c x}\right )}{d^2}+\frac{c \left (a+b \tan ^{-1}(c x)\right )}{d^2 (-c x+i)}-\frac{a+b \tan ^{-1}(c x)}{d^2 x}-\frac{2 i c \log \left (\frac{2}{1+i c x}\right ) \left (a+b \tan ^{-1}(c x)\right )}{d^2}-\frac{2 i a c \log (x)}{d^2}-\frac{b c \log \left (c^2 x^2+1\right )}{2 d^2}-\frac{i b c}{2 d^2 (-c x+i)}+\frac{b c \log (x)}{d^2}+\frac{i b c \tan ^{-1}(c x)}{2 d^2} \]

Antiderivative was successfully verified.

[In]

Int[(a + b*ArcTan[c*x])/(x^2*(d + I*c*d*x)^2),x]

[Out]

((-I/2)*b*c)/(d^2*(I - c*x)) + ((I/2)*b*c*ArcTan[c*x])/d^2 - (a + b*ArcTan[c*x])/(d^2*x) + (c*(a + b*ArcTan[c*
x]))/(d^2*(I - c*x)) - ((2*I)*a*c*Log[x])/d^2 + (b*c*Log[x])/d^2 - ((2*I)*c*(a + b*ArcTan[c*x])*Log[2/(1 + I*c
*x)])/d^2 - (b*c*Log[1 + c^2*x^2])/(2*d^2) + (b*c*PolyLog[2, (-I)*c*x])/d^2 - (b*c*PolyLog[2, I*c*x])/d^2 + (b
*c*PolyLog[2, 1 - 2/(1 + I*c*x)])/d^2

Rule 4876

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)*((f_.)*(x_))^(m_.)*((d_) + (e_.)*(x_))^(q_.), x_Symbol] :> Int[Ex
pandIntegrand[(a + b*ArcTan[c*x])^p, (f*x)^m*(d + e*x)^q, x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && IGtQ[p,
 0] && IntegerQ[q] && (GtQ[q, 0] || NeQ[a, 0] || IntegerQ[m])

Rule 4852

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[((d*x)^(m + 1)*(a + b*ArcTa
n[c*x])^p)/(d*(m + 1)), x] - Dist[(b*c*p)/(d*(m + 1)), Int[((d*x)^(m + 1)*(a + b*ArcTan[c*x])^(p - 1))/(1 + c^
2*x^2), x], x] /; FreeQ[{a, b, c, d, m}, x] && IGtQ[p, 0] && (EqQ[p, 1] || IntegerQ[m]) && NeQ[m, -1]

Rule 266

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Dist[1/n, Subst[Int[x^(Simplify[(m + 1)/n] - 1)*(a
+ b*x)^p, x], x, x^n], x] /; FreeQ[{a, b, m, n, p}, x] && IntegerQ[Simplify[(m + 1)/n]]

Rule 36

Int[1/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Dist[b/(b*c - a*d), Int[1/(a + b*x), x], x] -
Dist[d/(b*c - a*d), Int[1/(c + d*x), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0]

Rule 29

Int[(x_)^(-1), x_Symbol] :> Simp[Log[x], x]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 4848

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))/(x_), x_Symbol] :> Simp[a*Log[x], x] + (Dist[(I*b)/2, Int[Log[1 - I*c*x
]/x, x], x] - Dist[(I*b)/2, Int[Log[1 + I*c*x]/x, x], x]) /; FreeQ[{a, b, c}, x]

Rule 2391

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> -Simp[PolyLog[2, -(c*e*x^n)]/n, x] /; FreeQ[{c, d,
 e, n}, x] && EqQ[c*d, 1]

Rule 4862

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))*((d_) + (e_.)*(x_))^(q_.), x_Symbol] :> Simp[((d + e*x)^(q + 1)*(a + b*
ArcTan[c*x]))/(e*(q + 1)), x] - Dist[(b*c)/(e*(q + 1)), Int[(d + e*x)^(q + 1)/(1 + c^2*x^2), x], x] /; FreeQ[{
a, b, c, d, e, q}, x] && NeQ[q, -1]

Rule 627

Int[((d_) + (e_.)*(x_))^(m_.)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[(d + e*x)^(m + p)*(a/d + (c*x)/e)^
p, x] /; FreeQ[{a, c, d, e, m, p}, x] && EqQ[c*d^2 + a*e^2, 0] && (IntegerQ[p] || (GtQ[a, 0] && GtQ[d, 0] && I
ntegerQ[m + p]))

Rule 44

Int[((a_) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*
x)^n, x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, 0] && IntegerQ[n] &&  !(IGtQ[n, 0] && L
tQ[m + n + 2, 0])

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 4854

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)/((d_) + (e_.)*(x_)), x_Symbol] :> -Simp[((a + b*ArcTan[c*x])^p*Lo
g[2/(1 + (e*x)/d)])/e, x] + Dist[(b*c*p)/e, Int[((a + b*ArcTan[c*x])^(p - 1)*Log[2/(1 + (e*x)/d)])/(1 + c^2*x^
2), x], x] /; FreeQ[{a, b, c, d, e}, x] && IGtQ[p, 0] && EqQ[c^2*d^2 + e^2, 0]

Rule 2402

Int[Log[(c_.)/((d_) + (e_.)*(x_))]/((f_) + (g_.)*(x_)^2), x_Symbol] :> -Dist[e/g, Subst[Int[Log[2*d*x]/(1 - 2*
d*x), x], x, 1/(d + e*x)], x] /; FreeQ[{c, d, e, f, g}, x] && EqQ[c, 2*d] && EqQ[e^2*f + d^2*g, 0]

Rule 2315

Int[Log[(c_.)*(x_)]/((d_) + (e_.)*(x_)), x_Symbol] :> -Simp[PolyLog[2, 1 - c*x]/e, x] /; FreeQ[{c, d, e}, x] &
& EqQ[e + c*d, 0]

Rubi steps

\begin{align*} \int \frac{a+b \tan ^{-1}(c x)}{x^2 (d+i c d x)^2} \, dx &=\int \left (\frac{a+b \tan ^{-1}(c x)}{d^2 x^2}-\frac{2 i c \left (a+b \tan ^{-1}(c x)\right )}{d^2 x}+\frac{c^2 \left (a+b \tan ^{-1}(c x)\right )}{d^2 (-i+c x)^2}+\frac{2 i c^2 \left (a+b \tan ^{-1}(c x)\right )}{d^2 (-i+c x)}\right ) \, dx\\ &=\frac{\int \frac{a+b \tan ^{-1}(c x)}{x^2} \, dx}{d^2}-\frac{(2 i c) \int \frac{a+b \tan ^{-1}(c x)}{x} \, dx}{d^2}+\frac{\left (2 i c^2\right ) \int \frac{a+b \tan ^{-1}(c x)}{-i+c x} \, dx}{d^2}+\frac{c^2 \int \frac{a+b \tan ^{-1}(c x)}{(-i+c x)^2} \, dx}{d^2}\\ &=-\frac{a+b \tan ^{-1}(c x)}{d^2 x}+\frac{c \left (a+b \tan ^{-1}(c x)\right )}{d^2 (i-c x)}-\frac{2 i a c \log (x)}{d^2}-\frac{2 i c \left (a+b \tan ^{-1}(c x)\right ) \log \left (\frac{2}{1+i c x}\right )}{d^2}+\frac{(b c) \int \frac{1}{x \left (1+c^2 x^2\right )} \, dx}{d^2}+\frac{(b c) \int \frac{\log (1-i c x)}{x} \, dx}{d^2}-\frac{(b c) \int \frac{\log (1+i c x)}{x} \, dx}{d^2}+\frac{\left (2 i b c^2\right ) \int \frac{\log \left (\frac{2}{1+i c x}\right )}{1+c^2 x^2} \, dx}{d^2}+\frac{\left (b c^2\right ) \int \frac{1}{(-i+c x) \left (1+c^2 x^2\right )} \, dx}{d^2}\\ &=-\frac{a+b \tan ^{-1}(c x)}{d^2 x}+\frac{c \left (a+b \tan ^{-1}(c x)\right )}{d^2 (i-c x)}-\frac{2 i a c \log (x)}{d^2}-\frac{2 i c \left (a+b \tan ^{-1}(c x)\right ) \log \left (\frac{2}{1+i c x}\right )}{d^2}+\frac{b c \text{Li}_2(-i c x)}{d^2}-\frac{b c \text{Li}_2(i c x)}{d^2}+\frac{(b c) \operatorname{Subst}\left (\int \frac{1}{x \left (1+c^2 x\right )} \, dx,x,x^2\right )}{2 d^2}+\frac{(2 b c) \operatorname{Subst}\left (\int \frac{\log (2 x)}{1-2 x} \, dx,x,\frac{1}{1+i c x}\right )}{d^2}+\frac{\left (b c^2\right ) \int \frac{1}{(-i+c x)^2 (i+c x)} \, dx}{d^2}\\ &=-\frac{a+b \tan ^{-1}(c x)}{d^2 x}+\frac{c \left (a+b \tan ^{-1}(c x)\right )}{d^2 (i-c x)}-\frac{2 i a c \log (x)}{d^2}-\frac{2 i c \left (a+b \tan ^{-1}(c x)\right ) \log \left (\frac{2}{1+i c x}\right )}{d^2}+\frac{b c \text{Li}_2(-i c x)}{d^2}-\frac{b c \text{Li}_2(i c x)}{d^2}+\frac{b c \text{Li}_2\left (1-\frac{2}{1+i c x}\right )}{d^2}+\frac{(b c) \operatorname{Subst}\left (\int \frac{1}{x} \, dx,x,x^2\right )}{2 d^2}+\frac{\left (b c^2\right ) \int \left (-\frac{i}{2 (-i+c x)^2}+\frac{i}{2 \left (1+c^2 x^2\right )}\right ) \, dx}{d^2}-\frac{\left (b c^3\right ) \operatorname{Subst}\left (\int \frac{1}{1+c^2 x} \, dx,x,x^2\right )}{2 d^2}\\ &=-\frac{i b c}{2 d^2 (i-c x)}-\frac{a+b \tan ^{-1}(c x)}{d^2 x}+\frac{c \left (a+b \tan ^{-1}(c x)\right )}{d^2 (i-c x)}-\frac{2 i a c \log (x)}{d^2}+\frac{b c \log (x)}{d^2}-\frac{2 i c \left (a+b \tan ^{-1}(c x)\right ) \log \left (\frac{2}{1+i c x}\right )}{d^2}-\frac{b c \log \left (1+c^2 x^2\right )}{2 d^2}+\frac{b c \text{Li}_2(-i c x)}{d^2}-\frac{b c \text{Li}_2(i c x)}{d^2}+\frac{b c \text{Li}_2\left (1-\frac{2}{1+i c x}\right )}{d^2}+\frac{\left (i b c^2\right ) \int \frac{1}{1+c^2 x^2} \, dx}{2 d^2}\\ &=-\frac{i b c}{2 d^2 (i-c x)}+\frac{i b c \tan ^{-1}(c x)}{2 d^2}-\frac{a+b \tan ^{-1}(c x)}{d^2 x}+\frac{c \left (a+b \tan ^{-1}(c x)\right )}{d^2 (i-c x)}-\frac{2 i a c \log (x)}{d^2}+\frac{b c \log (x)}{d^2}-\frac{2 i c \left (a+b \tan ^{-1}(c x)\right ) \log \left (\frac{2}{1+i c x}\right )}{d^2}-\frac{b c \log \left (1+c^2 x^2\right )}{2 d^2}+\frac{b c \text{Li}_2(-i c x)}{d^2}-\frac{b c \text{Li}_2(i c x)}{d^2}+\frac{b c \text{Li}_2\left (1-\frac{2}{1+i c x}\right )}{d^2}\\ \end{align*}

Mathematica [A]  time = 0.287197, size = 165, normalized size = 0.85 \[ -\frac{-2 b c \text{PolyLog}(2,-i c x)+2 b c \text{PolyLog}(2,i c x)-2 b c \text{PolyLog}\left (2,\frac{c x+i}{c x-i}\right )+\frac{2 \left (a+b \tan ^{-1}(c x)\right )}{x}+\frac{2 c \left (a+b \tan ^{-1}(c x)\right )}{c x-i}+4 i c \log \left (\frac{2 i}{-c x+i}\right ) \left (a+b \tan ^{-1}(c x)\right )+4 i a c \log (x)+b c \left (\log \left (c^2 x^2+1\right )-2 \log (x)\right )+i b c \left (-\tan ^{-1}(c x)+\frac{1}{-c x+i}\right )}{2 d^2} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*ArcTan[c*x])/(x^2*(d + I*c*d*x)^2),x]

[Out]

-(I*b*c*((I - c*x)^(-1) - ArcTan[c*x]) + (2*(a + b*ArcTan[c*x]))/x + (2*c*(a + b*ArcTan[c*x]))/(-I + c*x) + (4
*I)*a*c*Log[x] + (4*I)*c*(a + b*ArcTan[c*x])*Log[(2*I)/(I - c*x)] + b*c*(-2*Log[x] + Log[1 + c^2*x^2]) - 2*b*c
*PolyLog[2, (-I)*c*x] + 2*b*c*PolyLog[2, I*c*x] - 2*b*c*PolyLog[2, (I + c*x)/(-I + c*x)])/(2*d^2)

________________________________________________________________________________________

Maple [A]  time = 0.072, size = 340, normalized size = 1.8 \begin{align*} -{\frac{ca}{{d}^{2} \left ( cx-i \right ) }}-2\,{\frac{ca\arctan \left ( cx \right ) }{{d}^{2}}}+{\frac{ica\ln \left ({c}^{2}{x}^{2}+1 \right ) }{{d}^{2}}}-{\frac{a}{{d}^{2}x}}-{\frac{2\,icb\arctan \left ( cx \right ) \ln \left ( cx \right ) }{{d}^{2}}}-{\frac{bc\arctan \left ( cx \right ) }{{d}^{2} \left ( cx-i \right ) }}+{\frac{{\frac{i}{2}}bc\arctan \left ( cx \right ) }{{d}^{2}}}-{\frac{b\arctan \left ( cx \right ) }{{d}^{2}x}}+{\frac{2\,icb\arctan \left ( cx \right ) \ln \left ( cx-i \right ) }{{d}^{2}}}-{\frac{bc\ln \left ( -i \left ( -cx+i \right ) \right ) \ln \left ( -icx \right ) }{{d}^{2}}}+{\frac{bc\ln \left ( -i \left ( -cx+i \right ) \right ) \ln \left ( cx \right ) }{{d}^{2}}}-{\frac{bc{\it dilog} \left ( -icx \right ) }{{d}^{2}}}-{\frac{bc{\it dilog} \left ( -i \left ( cx+i \right ) \right ) }{{d}^{2}}}-{\frac{cb\ln \left ( cx \right ) \ln \left ( -i \left ( cx+i \right ) \right ) }{{d}^{2}}}+{\frac{bc{\it dilog} \left ( -{\frac{i}{2}} \left ( cx+i \right ) \right ) }{{d}^{2}}}+{\frac{bc\ln \left ( cx-i \right ) \ln \left ( -{\frac{i}{2}} \left ( cx+i \right ) \right ) }{{d}^{2}}}-{\frac{bc \left ( \ln \left ( cx-i \right ) \right ) ^{2}}{2\,{d}^{2}}}-{\frac{2\,ica\ln \left ( cx \right ) }{{d}^{2}}}-{\frac{bc\ln \left ({c}^{2}{x}^{2}+1 \right ) }{2\,{d}^{2}}}+{\frac{{\frac{i}{2}}bc}{{d}^{2} \left ( cx-i \right ) }}+{\frac{cb\ln \left ( cx \right ) }{{d}^{2}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*arctan(c*x))/x^2/(d+I*c*d*x)^2,x)

[Out]

-c*a/d^2/(c*x-I)-2*c*a/d^2*arctan(c*x)+I*c*a/d^2*ln(c^2*x^2+1)-a/d^2/x-2*I*c*b/d^2*arctan(c*x)*ln(c*x)-c*b/d^2
*arctan(c*x)/(c*x-I)+1/2*I*b*c*arctan(c*x)/d^2-b/d^2*arctan(c*x)/x+2*I*c*b/d^2*arctan(c*x)*ln(c*x-I)-c*b/d^2*l
n(-I*(-c*x+I))*ln(-I*c*x)+c*b/d^2*ln(-I*(-c*x+I))*ln(c*x)-c*b/d^2*dilog(-I*c*x)-c*b/d^2*dilog(-I*(c*x+I))-c*b/
d^2*ln(c*x)*ln(-I*(c*x+I))+c*b/d^2*dilog(-1/2*I*(c*x+I))+c*b/d^2*ln(c*x-I)*ln(-1/2*I*(c*x+I))-1/2*c*b/d^2*ln(c
*x-I)^2-2*I*c*a/d^2*ln(c*x)-1/2*b*c*ln(c^2*x^2+1)/d^2+1/2*I*c*b/d^2/(c*x-I)+c*b/d^2*ln(c*x)

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*}{\left (-2 i \, c \int \frac{\arctan \left (c x\right )}{c^{4} d^{2} x^{5} + 2 \, c^{2} d^{2} x^{3} + d^{2} x}\,{d x} - \int \frac{{\left (c^{2} x^{2} - 1\right )} \arctan \left (c x\right )}{c^{4} d^{2} x^{6} + 2 \, c^{2} d^{2} x^{4} + d^{2} x^{2}}\,{d x}\right )} b - a{\left (\frac{c}{c d^{2} x - i \, d^{2}} - \frac{2 i \, c \log \left (c x - i\right )}{d^{2}} + \frac{2 i \, c \log \left (x\right )}{d^{2}} + \frac{1}{d^{2} x}\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*arctan(c*x))/x^2/(d+I*c*d*x)^2,x, algorithm="maxima")

[Out]

(-2*I*c*integrate(arctan(c*x)/(c^4*d^2*x^5 + 2*c^2*d^2*x^3 + d^2*x), x) - integrate((c^2*x^2 - 1)*arctan(c*x)/
(c^4*d^2*x^6 + 2*c^2*d^2*x^4 + d^2*x^2), x))*b - a*(c/(c*d^2*x - I*d^2) - 2*I*c*log(c*x - I)/d^2 + 2*I*c*log(x
)/d^2 + 1/(d^2*x))

________________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (\frac{-i \, b \log \left (-\frac{c x + i}{c x - i}\right ) - 2 \, a}{2 \, c^{2} d^{2} x^{4} - 4 i \, c d^{2} x^{3} - 2 \, d^{2} x^{2}}, x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*arctan(c*x))/x^2/(d+I*c*d*x)^2,x, algorithm="fricas")

[Out]

integral((-I*b*log(-(c*x + I)/(c*x - I)) - 2*a)/(2*c^2*d^2*x^4 - 4*I*c*d^2*x^3 - 2*d^2*x^2), x)

________________________________________________________________________________________

Sympy [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: AttributeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*atan(c*x))/x**2/(d+I*c*d*x)**2,x)

[Out]

Exception raised: AttributeError

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{b \arctan \left (c x\right ) + a}{{\left (i \, c d x + d\right )}^{2} x^{2}}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*arctan(c*x))/x^2/(d+I*c*d*x)^2,x, algorithm="giac")

[Out]

integrate((b*arctan(c*x) + a)/((I*c*d*x + d)^2*x^2), x)